package com.cp.quartz;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

/**
 * @author ChengPeng
 * @create 2020-05-22 16:02
 */
public class MyJob2 extends QuartzJobBean {
    HelloService helloService;

    public void setHelloService(HelloService helloService){
        this.helloService =helloService;
    }
    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {

        System.out.println(helloService.sayHello());
    }
}
